import { defineStore } from 'pinia'
import { RouteRecordRaw } from 'vue-router'

export const useAppStore = defineStore('app', {
    state: () => {
        return {
            opened: true,
            withoutAnimation: false,
            routes:[],
            uname:''
        }
    },
//类似于computed 可以帮我们去修饰我们的值
getters: {

},
//可以操作异步 和 同步提交state
actions: {
    clearData(){
        // 清除所有数据
        this.routes = []
        this.uname = ""
        localStorage.clear()
    },
}
})